<?php
/**
 * +----------------------------------------------------------------------
 * | 九月科技-ztuc.cn
 * +----------------------------------------------------------------------
 *                      .::::.
 *                    .::::::::.            | AUTHOR: siyu
 *                    :::::::::::           | EMAIL: ztucke@ztuc.cn
 *                 ..:::::::::::'           | DATETIME: 2020/01/31
 *             '::::::::::::'
 *                .::::::::::
 *           '::::::::::::::..
 *                ..::::::::::::.
 *              ``::::::::::::::::
 *               ::::``:::::::::'        .:::.
 *              ::::'   ':::::'       .::::::::.
 *            .::::'      ::::     .:::::::'::::.
 *           .:::'       :::::  .:::::::::' ':::::.
 *          .::'        :::::.:::::::::'      ':::::.
 *         .::'         ::::::::::::::'         ``::::.
 *     ...:::           ::::::::::::'              ``::.
 *   ```` ':.          ':::::::::'                  ::::..
 *                      '.:::::'                    ':'````..
 * +----------------------------------------------------------------------
 */
declare (strict_types=1);

namespace app\lnadmin\validate;

use think\Validate;

class ChangePwd extends Validate
 {
protected $rule = [
         'password' => ['require', 'min' => 8, 'max' => 12, 'regex' => '/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{8,}$/
'],
         'new_password' => ['require', 'min' => 8, 'max' => 12, 'regex' => '/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{8,}$/
'],
         'rep_password' => 'require|confirm:new_password',
    ];

    protected $message = [
        'password.min' => '旧密码不能小于8个字符',
        'password.max' => '旧密码最多不能超过12个字符',
        'password.regex' => '旧密码必须包含大小写字母/数字/符号任意两者组合',
        'password.require' => '旧密码不能为空',
        'new_password.require' => '新密码不能为空',
        'rep_password.require' => '确认密码不能为空',
        'new_password.min' => '新密码不能小于8个字符',
        'new_password.max' => '新密码最多不能超过12个字符',
        'new_password.regex' => '新密码必须包含大小写字母/数字/符号任意两者组合',
        'rep_password.confirm' => '两次密码不一致！',
    ];

}